package org.huawei260.String;

import java.util.Scanner;

/**
 * @Auther: qingle
 * @Date: 2024/8/25-1:57
 * @Description:
 * @version: 1.0
 */
public class O0058_连续子串 {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String source = scanner.nextLine();
		String target = scanner.nextLine();

		System.out.println(findSubString(source, target));
	}

	private static int findSubString(String source, String target) {
		int len = target.length();
		int len1 = source.length();

		if (len > len1) {
			return -1;
		}

		// 不用Java自带函数
//		if (source.contains(target)) {
//			return source.indexOf(target);
//		} else {
//			return -1;
//		}

		for (int i = 0; i < source.length() - target.length(); i++) {
			String subString = source.substring(i, i + target.length());
			if(subString.equals(target)) {
				return i;
			}
		}
		return -1;
	}
}
